import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class code3 {
    public static int N = 55, M = 15;
    public static int n, k, d;
    public static long[] arr = new long[N];
    public static long[][] f = new long[N][M];
    public static long[][] g = new long[N][M];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        k = in.nextInt();
        d = in.nextInt();
        for (int i = 1; i <=n; i++) {
            arr[i] = in.nextLong();
        }


        for (int i = 1; i <= n; i++) { //填写每一行
            //初始化
            f[i][1] = g[i][1] = arr[i];
            for (int j = 2; j <= Math.min(k, i); j++) { //挑选j个人
                f[i][j] = Long.MIN_VALUE;//初始化
                g[i][j] = Long.MAX_VALUE;//初始化
                for (int prev = Math.max(i - d, j - 1); prev <= i - 1; prev++) {
                    f[i][j] = Math.max(Math.max(f[prev][j - 1] * arr[i],
                            g[prev][j - 1] * arr[i]), f[i][j]);
                    g[i][j] = Math.min(Math.min(f[prev][j - 1] * arr[i],
                            g[prev][j - 1] * arr[i]), g[i][j]);
                }
            }
        }

        long ret = Long.MIN_VALUE;
        for (int i = k; i <= n; i++) ret = Math.max(ret, f[i][k]);
        System.out.print(ret);
    }
}